package Controllers;

import Models.LoginModel;
import Models.PrinterModel;
import PrinterSource.PrinterManager;
import PrinterSource.QueryHandler;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class PrinterController extends HttpServlet {
    
    public void doPost(HttpServletRequest request, 
                      HttpServletResponse response) 
                      throws IOException, ServletException {
            


        //String printernumber = request.getParameter("PrinterSelected");
        //QueryHandler.get_printer_byName(printernumber);


        //PrinterModel model = manager.getModel(Integer.parseInt(printernumber));

       List<String> PrinterAddresses= QueryHandler.get_printers();

        request.setAttribute("PrinterModels", PrinterAddresses);
        RequestDispatcher view = request.getRequestDispatcher("PrinterDisplay.jsp");
        view.forward(request, response); 

    }
    
}
